<?php

class Domain51_Util_Service_Connection extends Solar_Base
{
    protected $_Domain51_Util_Service_Connection = array(
        'username'    => '',
        'password'    => '',
        'service_url' => '' 
    );
    
    public function __construct($config = null) {
        parent::__construct($config);
    }
    
        
    public function doRequest($uri) {
        $options = array(
            'httpauth' => "{$this->_config['username']}:{$this->_config['password']}",
            'httpauthtype' => HTTP_AUTH_BASIC
        );
        
        $request = new HTTPRequest();
        $request->setOptions($options);
        $request->setUrl($this->_config['service_url'] . $uri);
        
        $response = $request->send();
        return new SimpleXMLElement($response->getBody());
    }
}

?>